MagicCrypt
MagicCrypt is a Java/PHP/NodeJS/Rust library to encrypt/decrpyt strings, files, or data, using Data Encryption Standard(DES) or Advanced Encryption Standard(AES) algorithms. It supports CBC block cipher mode, PKCS5 padding and 64, 128, 192 or 256-bits key length.
For Rust
Example
use ;
let mc = new_magic_crypt!;
let base64 = mc.encrypt_str_to_base64;
assert_eq!;
assert_eq!;
Change the Buffer Size
The default buffer size for the encrypt_reader_to_writer
method and the decrypt_reader_to_writer
method is 4096 bytes. If you want to change that, you can use the encrypt_reader_to_writer2
method or the decrypt_reader_to_writer2
method, and define a length explicitly.
For example, to change the buffer size to 256 bytes,
use Cursor;
use Engine;
use ;
use U256;
let mc = new_magic_crypt!;
let mut reader = new;
let mut writer = Vec new;
mc..unwrap;
let base64 = STANDARD.encode;
assert_eq!;
assert_eq!;
No Std
Disable the default features to compile this crate without std.
[]
= "*"
= false
Crates.io
https://crates.io/crates/magic-crypt
Documentation
For Java
Refer to https://github.com/magiclen/MagicCrypt.
For PHP
Refer to https://github.com/magiclen/MagicCrypt.
For NodeJS
Refer to https://github.com/magiclen/node-magiccrypt.
License
What's More?
Please check out our web page at